/*
 * Copyright 2020-2021 redragon.dongbin
 *
 * This file is part of redragon-erp/赤龙ERP.

 * redragon-erp/赤龙ERP is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.

 * redragon-erp/赤龙ERP is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with redragon-erp/赤龙ERP.  If not, see <https://www.gnu.org/licenses/>.
 */
package com.erp.prod.craft.dao.model;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

@Entity
@Table(name="prod_work_craft_procedure", schema="erp")
@DynamicInsert(true)
@DynamicUpdate(true)
public class ProdWorkCraftProcedure implements java.io.Serializable {

    //serialVersionUID
    private static final long serialVersionUID = 1L;

    //Constructors
    public ProdWorkCraftProcedure() {
    }
    
    //Fields
    
    //主键
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "craft_procedure_id", unique = true, nullable = false)
    private Integer craftProcedureId;
    
    public Integer getCraftProcedureId() {
        return this.craftProcedureId;
    }
    public void setCraftProcedureId(Integer craftProcedureId) {
        this.craftProcedureId = craftProcedureId;
    }
    
    //编码
    @Column(name = "craft_procedure_code", unique = true, nullable = false, length = 45)
    private String craftProcedureCode;
    
    public String getCraftProcedureCode() {
        return this.craftProcedureCode;
    }
    public void setCraftProcedureCode(String craftProcedureCode) {
        this.craftProcedureCode = craftProcedureCode;
    }
    
    //工艺编码
    @NotBlank(message="工艺编码不能为空")
    @Column(name = "craft_code", unique = false, nullable = false, length = 45)
    private String craftCode;
    
    public String getCraftCode() {
        return this.craftCode;
    }
    public void setCraftCode(String craftCode) {
        this.craftCode = craftCode;
    }
    
    //序号
    @NotNull(message="工艺路线行序号不能为空")
    @Column(name = "order_number", unique = false, nullable = false)
    private Integer orderNumber;
    
    public Integer getOrderNumber() {
        return this.orderNumber;
    }
    public void setOrderNumber(Integer orderNumber) {
        this.orderNumber = orderNumber;
    }
    
    //工序编码
    @Column(name = "procedure_code", unique = false, nullable = false, length = 45)
    private String procedureCode;
    
    public String getProcedureCode() {
        return this.procedureCode;
    }
    public void setProcedureCode(String procedureCode) {
        this.procedureCode = procedureCode;
    }
    
    //工作中心编码
    @NotBlank(message="工作中心不能为空")
    @Column(name = "work_center_code", unique = false, nullable = false, length = 45)
    private String workCenterCode;
    
    public String getWorkCenterCode() {
        return this.workCenterCode;
    }
    public void setWorkCenterCode(String workCenterCode) {
        this.workCenterCode = workCenterCode;
    }
    
    //生产前置期
    @NotNull(message="生产前置期不能为空")
    @Column(name = "produce_pre_days", unique = false, nullable = false)
    private Double producePreDays;
    
    public Double getProducePreDays() {
        return this.producePreDays;
    }
    public void setProducePreDays(Double producePreDays) {
        this.producePreDays = producePreDays;
    }
    
    //摘要
    @Column(name = "memo", unique = false, nullable = true, length = 500)
    private String memo;
    
    public String getMemo() {
        return this.memo;
    }
    public void setMemo(String memo) {
        this.memo = memo;
    }
    
    //版本
    @Column(name = "version", unique = false, nullable = false)
    private Integer version;
    
    public Integer getVersion() {
        return this.version;
    }
    public void setVersion(Integer version) {
        this.version = version;
    }
    
    //状态
    @Column(name = "status", unique = false, nullable = false, length = 10)
    private String status;
    
    public String getStatus() {
        return this.status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    
    //创建时间
    @Column(name = "created_date", unique = false, nullable = false)
    private Date createdDate;
    
    public Date getCreatedDate() {
        return this.createdDate;
    }
    public void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
    }
    
    //创建人
    @Column(name = "created_by", unique = false, nullable = false, length = 45)
    private String createdBy;
    
    public String getCreatedBy() {
        return this.createdBy;
    }
    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }
    
    //最后修改时间
    @Column(name = "last_updated_date", unique = false, nullable = true)
    private Date lastUpdatedDate;
    
    public Date getLastUpdatedDate() {
        return this.lastUpdatedDate;
    }
    public void setLastUpdatedDate(Date lastUpdatedDate) {
        this.lastUpdatedDate = lastUpdatedDate;
    }
    
    //最后修改人
    @Column(name = "last_updated_by", unique = false, nullable = true, length = 45)
    private String lastUpdatedBy;
    
    public String getLastUpdatedBy() {
        return this.lastUpdatedBy;
    }
    public void setLastUpdatedBy(String lastUpdatedBy) {
        this.lastUpdatedBy = lastUpdatedBy;
    }
    
    //组织机构
    @Column(name = "org_code", unique = false, nullable = false, length = 10)
    private String orgCode;
    
    public String getOrgCode() {
        return this.orgCode;
    }
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
    
    
    
    //显示字段
    @Transient
    private String workCenterName;
    @Transient
    private String procedureName;

    public String getWorkCenterName() {
        return workCenterName;
    }
    public void setWorkCenterName(String workCenterName) {
        this.workCenterName = workCenterName;
    }
    public String getProcedureName() {
        return procedureName;
    }
    public void setProcedureName(String procedureName) {
        this.procedureName = procedureName;
    }
    
}